//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   SlabtranProblem.t.hh
 * \author Jeremy Roberts
 * \date   04/10/2011
 * \brief  SlabtranProblem member definitions.
 * \note   Copyright (C) 2011 Jeremy Roberts
 */
//---------------------------------------------------------------------------//
// $Rev::                                               $:Rev of last commit
// $Author::                                            $:Author of last commit
// $Date::                                              $:Date of last commit
//---------------------------------------------------------------------------//

#include <iostream>

#include "tran/SlabtranProblem.hh"

// Source types
#include "ZeroSource.hh"
#include "UniformSource.hh"

// Note, SlabtranProblem acts essentially as Manager does in Denovo.

namespace slabtran
{

//---------------------------------------------------------------------------//
// CONSTRUCTOR
//---------------------------------------------------------------------------//
template<class Equations, class D>
SlabtranProblem<Equations,D>::SlabtranProblem( SlabtranInput input, int elid )
 :   d_input(&input),
     d_element(input.element(elid)),
     d_element_id(elid)
{

	// build the mesh
	//d_mesh = new Mesh<N>(d_input,d_element);

	// build the source
	build_source();

	// build the state (fluxes, response functions, basis set)
	//d_state = new

	// build the angular mesh
	d_octants = new AngularMesh<D>( d_input->quadord(),
                                    0,       // gauss
                                    false);  // no adjoint for now

	// build the within-group solver
	//d_within_group_solver

	// build the solver
	// d_solver


    return;
}

//---------------------------------------------------------------------------//
// DESTRUCTOR
//---------------------------------------------------------------------------//
template<class Equations, class D>
SlabtranProblem<Equations,D>::~SlabtranProblem()
{
	return;
}

template<class Equations, class D>
void SlabtranProblem<Equations,D>::build_source()
{
	std::cout << " building source " << std::endl;

	// just make a constant source for testing
	d_source = new UniformSource<D>(d_input->number_groups(), 1.0);

	return;
}

} // end namespace slabtran

//---------------------------------------------------------------------------//
//         end of SlabtranProblem.t.hh
//---------------------------------------------------------------------------//

